getDominantColors

abstract suspend fun getDominantColors(block: DesignBlock, options: DominantColorsOptions = DominantColorsOptions()): List<DominantColor>

Extracts the dominant colors from the rendered appearance of a block.

Performs an internal update to resolve the final layout for the block. Will not complete as long as assets are in a pending state; asset loading progresses during engine updates. Crops, color adjustments, and effects applied to the block are reflected in the returned palette. Fully or mostly transparent pixels are excluded from the analysis.

Return

the dominant colors sorted by weight, descending.

Parameters

block

the design block to analyze. Must be attached to a scene and render visible content.

options

the analysis options.